<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>绘制路径</title>
<style>
	body{
		text-align: center;
	}	
	#c{
		border: 1px solid #000;
	}
</style>
</head>
<canvas id="c" width="800" height="600">
	
</canvas>
<script>
	var ctx=c.getContext("2d");
	ctx.beginPath();
	ctx.arc(400,300,100,-0.25*Math.PI,0.25*Math.PI,true);
	ctx.moveTo(400+50*Math.sqrt(2),300+50*Math.sqrt(2));
	ctx.lineTo(400,300);
	ctx.moveTo(400,300);
	ctx.lineTo(400+50*Math.sqrt(2),300-50*Math.sqrt(2));
	ctx.closePath();
	ctx.stroke();
	ctx.beginPath();
	var g=ctx.createLinearGradient(400,150,400,300);
	g.addColorStop(0, '#fff');		
  	g.addColorStop(0.5, 'blue');		
  	g.addColorStop(1, 'blue');
	ctx.arc(380,240,10,0,2*Math.PI,false);
	ctx.closePath();
	ctx.fillStyle=g;
	ctx.fill();
</script>
<body>
</body>
</html>

